<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<style type="text/css">
	body{
	background:url(images/1.jpg);
	background-size:100% 100%;
	margin:0 auto;
	}
	h1{
		margin-top: 80px;
		text-align: center;
	}	
	#login_frame {
    width: 440px;
    height: 360px;
    padding: 13px;
 
    position: absolute;
    left: 50%;
    top: 40%;
    margin-left: -200px;
    margin-top: -200px;
 
    background-color: rgba(240, 255, 255, 0.5);
 
    border-radius: 10px;
    text-align: center;
	}
	</style>
</head>
<body>
<div id="login_frame">
<?php
echo "<center>";
echo "<h1>欢迎使用智能考试系统！</h1>";
if (null==($_COOKIE["user"] OR $_COOKIE["user"]==" "))
{
	echo "你还没有登录!<p>";
	echo "<a href='login_l.php'>登录</a> &nbsp;&nbsp;&nbsp;<a href='reg_l.php'>注册</a>";
}
else
{
	echo "欢迎您：".$_COOKIE["user"];
	echo "<p>";
	include "config.php";
	$sql="select admin from $test_user where name='$_COOKIE[user]'";
	$result=$mysqli->query($sql);
	$admin=$result->fetch_array();
	if ($admin[0]==0)
	{
		echo "你是普通用户，点<a href='exam.php'> 这里</a>查看考试安排";
	}
	else
	{
		echo "你是教务人员，点<a href='admin.php'>这里</a>对考试进行安排<br><br>";
		echo "点<a href='weektable.php'> 这里</a>查看学生课表";
	}
   echo "<p> 点<a href='edit_pass.php'>这里</a> 修改密码<p>";
   echo "<p> 点<a href='exit.php'>这里</a>退出登录<p>";
}
?>
</div>
</body>
</html>
